package com.h2.org.springframework.beans.factory;

import java.io.File;
import java.io.UnsupportedEncodingException;
import java.net.URL;
import java.net.URLDecoder;
import org.springframework.util.AntPathMatcher;

public class ResourceResolver
{
  public static final String CLASSPATH = "classpath";

  protected String resolveClassPath(String paramString, boolean paramBoolean)
  {
    String str = getClass().getClassLoader().getResource("").getPath();
    try
    {
      File localFile1 = new File(URLDecoder.decode(str, "UTF-8"));
      localFile2 = localFile1;
      if ((paramString.startsWith("\\")) || (paramString.startsWith("/")))
        paramString = paramString.substring(1);
      return resolveClassPathHelper(paramString, localFile2, paramBoolean);
    }
    catch (UnsupportedEncodingException localUnsupportedEncodingException)
    {
      while (true)
      {
        localUnsupportedEncodingException.printStackTrace();
        File localFile2 = null;
      }
    }
  }

  protected String resolveClassPathHelper(String paramString, File paramFile, boolean paramBoolean)
  {
    File[] arrayOfFile = paramFile.listFiles();
    AntPathMatcher localAntPathMatcher = new AntPathMatcher();
    String str = null;
    int i = arrayOfFile.length;
    for (int j = 0; ; j++)
    {
      if (j >= i);
      do
      {
        return str;
        File localFile = arrayOfFile[j];
        if (localAntPathMatcher.matchStart(paramString, localFile.getName()))
        {
          str = localFile.getPath();
          if (localFile.isDirectory())
            return paramFile.getPath() + "\\" + paramString;
        }
        else if ((localFile.isDirectory()) && (paramBoolean))
        {
          str = resolveClassPathHelper(paramString, localFile, paramBoolean);
        }
      }
      while (str != null);
    }
  }

  public String resolvePath(String paramString)
  {
    if (paramString.startsWith("classpath"))
    {
      if (!paramString.startsWith("classpath*:"))
        break label35;
      paramString = resolveClassPath(paramString.substring("classpath*:".length()), true);
    }
    label35: 
    while (!paramString.startsWith("classpath:"))
      return paramString;
    return resolveClassPath(paramString.substring("classpath:".length()), false);
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.h2.org.springframework.beans.factory.ResourceResolver
 * JD-Core Version:    0.6.2
 */